<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script src="https://unpkg.com/dexie@latest/dist/dexie.js"></script>
    <script>
        var db = new Dexie("friend_database");
        db.version(1).stores({
            friends: 'name,shoeSize'
        });
        // var arr = [];
        // for (let i = 0; i < 10; i++) {
        //     arr.push({
        //         name: "Nicolas" + i,
        //         shoeSize: 8
        //     });
        // }
        // db.friends.bulkPut(arr).then(function() {
        //     return db.friends.offset(2).limit(3).toArray();
        // }).then(function(friend) {
        //     console.log(friend);
        // }).catch(function(error) {
        //     console.log(error);
        // });

        db.friends.offset(5).limit(3).toArray().then(a => console.log(a));
        // console.log(a);
    </script>
</body>

</html>